package com.itheima.TSS;

import java.util.TreeSet;

/**
 * @author zhangbaiyan
 * @date 2024-09-11 22:39
 * @description:
 * @version:
 */
public class Students {
    public static void main(String[] args) {


//        1.
        TreeSetStudent ts1 = new TreeSetStudent("张三", 18);
        TreeSetStudent ts2 = new TreeSetStudent("李四", 19);
        TreeSetStudent ts3 = new TreeSetStudent("王五", 20);


        TreeSet<TreeSetStudent> ts = new TreeSet<>();


        ts.add(ts1);
        ts.add(ts2);
        ts.add(ts3);


        for (TreeSetStudent treeSetStudent : ts) {
            System.out.println(treeSetStudent);
        }

    }
}
